﻿
@{
    ViewBag.Title = "Info";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:void(0);">基本信息</a></li>
</ul>
<form id="form1">
    <div style="padding-top: 10px; margin-right: 20px;">
        <table class="form">
            <tr>
                <th class="formTitle">账户</th>
                <td class="formValue">
                    <input id="Account" name="Account" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入账户" disabled="disabled" />
                </td>
                <th class="formTitle">密码</th>
                <td class="formValue">
                    <input id="UserPassword" name="UserPassword" type="password" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入密码" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">公司</th>
                <td class="formValue">
                    <select id="OrganizeId" name="OrganizeId" class="form-control" isvalid="yes" checkexpession="NotNull" disabled="disabled"></select>
                </td>
                <th class="formTitle">部门</th>
                <td class="formValue">
                    <select id="DepartmentId" name="DepartmentId" class="form-control" isvalid="yes" checkexpession="NotNull" disabled="disabled">
                        <option value="">==请选择==</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">角色</th>
                <td class="formValue">
                    <select id="RoleId" name="RoleId" class="form-control" isvalid="yes" checkexpession="NotNull" disabled="disabled">
                        <option value="">==请选择==</option>
                    </select>
                </td>
                <th class="formTitle">岗位</th>
                <td class="formValue">
                    <select id="DutyId" name="DutyId" class="form-control" isvalid="yes" checkexpession="NotNull" disabled="disabled">
                        <option value="">==请选择==</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="RealName" name="RealName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" placeholder="请输入姓名" />
                </td>
                <th class="formTitle">性别</th>
                <td class="formValue">
                    <select id="Gender" name="Gender" class="form-control">
                        <option value="true">男</option>
                        <option value="false">女</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="formTitle">手机</th>
                <td class="formValue">
                    <input id="MobilePhone" name="MobilePhone" type="text" isvalid="yes" checkexpession="MobileOrNull" class="form-control" />
                </td>
                <th class="formTitle">生日</th>
                <td class="formValue">
                    <input id="Birthday" name="Birthday" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">微信</th>
                <td class="formValue">
                    <input id="WeChat" name="WeChat" type="text" class="form-control" />
                </td>
                <th class="formTitle">邮箱</th>
                <td class="formValue">
                    <input id="Email" name="Email" type="text" class="form-control" />
                </td>
            </tr>
            <tr>
                <th class="formTitle" valign="top" style="padding-top: 5px;">
                    备注
                </th>
                <td class="formValue" colspan="3">
                    <textarea id="Description" name="Description" class="form-control" style="height: 60px;"></textarea>
                </td>
            </tr>
        </table>
    </div>
    <div style="padding-left: 115px;">
        <a class="btn btn-primary" onclick="submitForm()"><i class="fa fa-save" style="margin-right:5px;"></i>确认修改</a>
    </div>
</form>
<script>
    $(function () {
        initControl();
        $.fn.setForm({
            url: "/SystemManage/User/GetUserInfo",
            success: function (data) {
                $("#form1").SetWebControls(data);
                $("#UserPassword").val("******");
            }
        });
    });
    function initControl() {
        $("#Gender").bindSelect()
        $("#IsAdministrator").bindSelect()
        $("#EnabledMark").bindSelect()
        $("#OrganizeId").bindSelect({
            url: "/SystemManage/Organize/GetTreeSelectJson"
        });
        $("#DepartmentId").bindSelect({
            url: "/SystemManage/Organize/GetTreeSelectJson",
        });
        $("#RoleId").bindSelect({
            url: "/SystemManage/Role/GetGridJson",
            id: "Id",
            text: "FullName"
        });
        $("#DutyId").bindSelect({
            url: "/SystemManage/Duty/GetGridJson",
            id: "Id",
            text: "FullName"
        });
    }
    function submitForm() {
        if (!$('#form1').Validform()) {
            return false;
        }
        $.fn.submitForm({
            url: "/SystemManage/User/SubmitForm?keyValue=" + keyValue,
            param: $("#form1").GetWebControls(),
            loading: "正在保存数据...",
            success: function (data) {
                alert(data);
            }
        })
    }
</script>

